package com.tepth.appmanageservice.tools;

import android.util.Log;

import com.tepth.appmanageservice.protocol.packets.Packets;
import com.tepth.appmanageservice.tools.ext.ExtToString;

import java.text.DateFormat;
import java.util.Date;

public class LogTool {
	public static void i(String tag, String msg) {
		DateFormat df3 = DateFormat.getTimeInstance();
		Log.i(tag, "时间:" + df3.format(new Date()) + " " + msg);
	}

	public static void received(byte[] msg) {
		i("接收", ExtToString.fromByteArrayForHex(msg));
	}

	public static void send(byte[] msg) {
		i("发送中", ExtToString.fromByteArrayForHex(msg));
	}

	public static void sendSuccess(byte[] msg) {
		i("发送完成", ExtToString.fromByteArrayForHex(msg));
	}

	public static void i(String tag, Packets packets) {
		i(tag, packets.toString());
	}
}